
import watch from '@nodejs/watch'
import { join } from 'path';
import { spawn } from 'child_process';

function bootstrap() {
    const root = process.cwd()
    watch([
        join(root, 'src/*.ts'),
        join(root, 'src/**/*.ts'),
    ], (e) => {
        console.log(e)
        spawn('tsc', ['-p', 'tsconfig.json'], {
            cwd: root
        })
    })
}

bootstrap();